home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 14 / 014.d81 / pps #36 < prev    next >
Text File  |  2022-08-26  |  4KB  |  245 lines

  1.  
  2. ======================================
  3.    PEEKs, POKEs, & SYSes -- Part 36
  4.  
  5.        By James Germany Weiler
  6.           and Alien Gardner
  7. ======================================
  8.   Bit-mapped graphics: how to do it
  9.     using the SYSPLOTTER routines.
  10. - - - - - - - - - - - - - - - - - - -
  11.  
  12.  
  13.   Okay, so here's what you've been
  14.  
  15. waiting for -- the easy way to use
  16.  
  17. hi-res bit-mapped graphics -- use our
  18.  
  19. SYSPLOTTER routines.
  20.  
  21.   First, you need to load them:
  22.  
  23.  
  24. 10 IFL=0THENL=1:LOAD"SYSPLOTTER.O",8,1
  25.  
  26.  
  27. After that, it gets simple fast.
  28.  
  29.  
  30. A. SETGRAPHIC
  31.    To set the bit mapped graphics
  32.    mode, SYS 49152.
  33.  
  34. B. CLEARGRAPHIC
  35.    To clear the graphics screen,
  36.    SYS 49158.
  37.  
  38. C1.COLORSMEAR
  39.    To set the background color,
  40.    SYS 49161, <0-15>.
  41.  
  42. C2.PLOTCOLOR
  43.    To set the "pen" color,
  44.    SYS 49164, <0-15>.
  45.  
  46. D1.DRAW
  47.    To plot a point,
  48.    SYS 49167, <0-319>, <0-199>.
  49.  
  50. D2.ERASE
  51.    To erase a point,
  52.    SYS 49170, <0-319>, <0-199>.
  53.  
  54. E. UNGRAPHIC
  55.    To turn off the graphics screen
  56.    and return to the text screen,
  57.    SYS 49155.
  58.  
  59. ======================================
  60.  
  61.   Now the details.
  62.  
  63.  
  64. SETGRAPHIC (49152), UNGRAPHIC (49155),
  65.  
  66. and CLEARGRAPHIC (49158) are just
  67.  
  68. simple SYSes.
  69.  
  70.  
  71.  
  72. SETGRAPHIC turns on the bit-mapped
  73.  graphic screen with a base address
  74.  of 8192.
  75.  
  76. UNGRAPHIC turns on the normal text
  77.  screen.
  78.  
  79. CLEARGRAPHIC erases any bit-mapped
  80.  pattern on the high-resolution
  81.  screen.  It is equivalent to poking
  82.  zeros into all memory locations from
  83.  8192 to 16191.
  84.  
  85. - - - - - - - - - - - - - - - - - - -
  86.  
  87. COLORSMEAR (49161) & PLOTCOLOR (49164)
  88.  
  89. are SYSes that must be followed by a
  90.  
  91. comma and one numeric expression.
  92.  
  93.   The numeric expression should
  94.  
  95. evaluate from 0 to 15.  It selects the
  96.  
  97. color of the background or pen for the
  98.  
  99. entire screen.  The numeric expression
  100.  
  101. can be a constant, a variable, or
  102.  
  103. an expression.
  104.  
  105. Examples:
  106.  
  107. COLORSMEAR --
  108.  
  109. SYS 49161,2
  110.  
  111.  will change the backgrond color of
  112.  the entire screen to red.
  113.  
  114.  
  115. PLOTCOLOR --
  116.  
  117. Z = 0: SYS 49164,Z
  118.  
  119.  will change the color of all the
  120.  plotted points on the screen to
  121.  black.
  122.  
  123. - - - - - - - - - - - - - - - - - - -
  124.  
  125. DRAW (49167) and ERASE (49170) are
  126.  
  127. SYSes that must be followed by two
  128.  
  129. numeric expressions separated by
  130.  
  131. commas.  The first expression is
  132.  
  133. the horizontal position to plot and
  134.  
  135. should be in the range 0 to 319.
  136.  
  137. The second expression is the vertical
  138.  
  139. position and should be from 0 to 199.
  140.  
  141.  
  142. Examples:
  143.  
  144. -- DRAW --
  145. FOR A = 0 to 20
  146. SYS 49167,A,A
  147. NEXT A
  148.  
  149.  will draw a short diagonal line in
  150.  the upper left corner of the screen.
  151.  
  152.  
  153. -- ERASE --
  154. FOR A = 0 to 10
  155. SYS 49170,A*2,A*2
  156. NEXT A
  157.  
  158.  will turn the diagonal line we drew
  159.  in the previous example into a dotted
  160.  line by turning off every other dot
  161.  along its length.  Erase will turn
  162.  off any dot, but you won't see it
  163.  working unless the dot was already
  164.  on.
  165.  
  166. ======================================
  167.  
  168.   We've done the hard part for you,
  169.  
  170. now how about some of you bright
  171.  
  172. programmers coming up with
  173.  
  174. applications using bit-mapped graphic
  175.  
  176. design?  How about a business program
  177.  
  178. with bar charts and pie graphics?
  179.  
  180. How about a program to display math
  181.  
  182. functions?  How about an astronomy
  183.  
  184. program?  The possibilities are
  185.  
  186. endless!
  187.  
  188.   If you need something to get you
  189.  
  190. started, take a look at the programs,
  191.  
  192. SINE.BAS and SINE.ML on this disk.
  193.  
  194. Compare the efficiency of the purely
  195.  
  196. BASIC program with the one that uses
  197.  
  198. our SYSPLOTTER routines.  We think
  199.  
  200. you'll be excited.
  201.  
  202.   We also have a wonderful application
  203.  
  204. of bit-mapped graphics.  On this
  205.  
  206. issue of LOADSTAR, you will find a
  207.  
  208. program that will print high-res text
  209.  
  210. onto a bit-mapped screen.  It is on
  211.  
  212. Side 2 and is called PLOTTEXT.  It
  213.  
  214. only supports numbers, lower case
  215.  
  216. letters, periods, commas, dollar
  217.  
  218. signs, and percent signs.
  219.  
  220.   The machine-language SYSPLOTTER
  221.  
  222. routines are on Side 2 of this issue
  223.  
  224. of LOADSTAR. They were written by
  225.  
  226. Alien Gardner with the MERLIN
  227.  
  228. assembler. The three BASIC programs
  229.  
  230. were written by James Germany Weiler
  231.  
  232. using the SYSPLOTTER routines.
  233.  
  234.   Next time, we hope to have a version
  235.  
  236. of SYSPLOTTER that draw lines. Until
  237.  
  238. then, happy plotting!
  239.  
  240.   If you wish to try any of the three
  241. \oad"plotter boot",8
  242. BASIC programs press the '\' key now.
  243.  
  244. ---------< end of article >-----------
  245.